<template>
  <div class="BeatsPill">
    <h1 class="title">
      <span>Beats Pill+</span>
    </h1>

    <div v-for="(item,index) in newData" :key="index">
      <Swiper v-if='item.type=="swiperList"' :dataList="item.data"></Swiper>
    </div>

    <div class="container">
      <h1>Beats Pill+ 音色饱满清晰，通透的音场可渗透房间每个角落，不但表现细腻，而且动力强劲</h1>
      <ul>
        <li>
          <img src="@/assets/images/BeatsPill/content1.png">
          <h2>体型小巧，声音澎湃</h2>
          <span>无论欣赏哪种类型的音乐，立体声有源双向分频系统都能让你获得理想的动态音域和清晰度，尽享优化的音场。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsPill/content2.png">
          <h2>让立体声更“立体”</h2>
          <span>下载 iOS 版 Beats Pill+ App 或 Android 版 Beats App，搭配另一台扬声器，获得更饱满的声音或立体声音效。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsPill/content3.png">
          <h2>全天电力强劲</h2>
          <span>电池续航时间可达 12 小时，并且支持 3 小时内快速充满电，确保可外出聆听音乐，并使用 Beats Pill+ 的剩余电量为手机充电。</span>
        </li>
        <li>
          <img src="@/assets/images/BeatsPill/content4.png">
          <h2>内置麦克风</h2>
          <span>语音性能增强，让你不论身在何处都能清晰地拨打和接听电话。</span>
        </li>
      </ul>

      <div class="box" @click="boxClick()">
        <h2>
          查看所有详情
          <img id="icon" src="https://www.beatsbydre.com.cn/content/dam/beats/web/common/icons/misc/png/circle-chevron.png.large.1x.png">
        </h2>

        <div class="message" v-show="!isActive">
          <div style="margin-top: 50px;">
            <h2>音质</h2>
            <ul>
              <li>
                <span>- 音质细腻纯正</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>设计</h2>
            <ul>
              <li>
                <span>- 便携紧凑的设计</span>
              </li>
              <li>
                <span>- 高度：2.5 英寸/6.36 厘米</span>
              </li>
              <li>
                <span>- 长度：8.27 英寸/21 厘米</span>
              </li>
              <li>
                <span>- 宽度：2.72 英寸/6.92 厘米</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>连接方式</h2>
            <ul>
              <li>
                <span>- 通过蓝牙® 设备配对和播放</span>
              </li>
              <li>
                <span>- 立体声蓝牙®让两台 Beats Pill+ 扬声器同步分别播放音乐的左右声道</span>
              </li>
              <li>
                <span>- 输入类型：3.5 毫米插孔</span>
              </li>
              <li>
                <span>- 兼容 Android</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>电源</h2>
            <ul>
              <li>
                <span>- 使用时间长达 12 小时的可充电电池</span>
              </li>
              <li>
                <span>- 耳机插入电源时，LED 电量指示灯将显示电量充满或电量耗尽；耳机未插入电源时，LED 电量指示灯将显示电量充满、电量低或电量耗尽</span>
              </li>
              <li>
                <span>- 可为 iPhone 和其他设备充电；闪电转 USB-A 充电线</span>
              </li>
              <li>
                <span>- 随附电源适配器和闪电连接线</span>
              </li>
              <li>
                <span>-锂离子充电电池</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>控制按钮</h2>
            <ul>
              <li>
                <span>- 多功能的“b”键可以播放、暂停、跳过曲目和控制通话</span>
              </li>
              <li>
                <span>- 增强的麦克风让你能清晰地拨打和接听电话。</span>
              </li>
              <li>
                <span>- 下载 iOS 版 Beats Pill+ App 或 Android 版 Beats App，搭配另一台扬声器，获得更饱满的声音或立体声音效</span>
              </li>
            </ul>
          </div>

          <div style="margin-top: 50px;">
            <h2>包装内容</h2>
            <ul>
              <li>
                <span>- Beats Pill+ 扬声器</span>
              </li>
              <li>
                <span>- 1.5 米闪电转 USB-A 充电线</span>
              </li>
              <li>
                <span>- 12.5W 电源适配器</span>
              </li>
              <li>
                <span>- 快速入门指南</span>
              </li>
              <li>
                <span>- 保修卡</span>
              </li>
            </ul>
          </div>

        </div>

      </div>
    </div>

    <img src="https://www.beatsbydre.com.cn/content/dam/beats/web/product/speakers/pill-plus/pdp/202010/pillplus-pdp-p02.jpg.large.1x.jpg"
         style="width: 10rem; margin-top: 50px;">

    <div style="height: 100px;"></div>

  </div>
</template>

<script>
import Swiper from "@/components/home/Swiper";
import {api1} from "@/common/api/request";

export default {
  name: "BeatsPill",
  data(){
    return{
      newData:[],
      path:'/home/PowerBeats',
      isActive: true
    }
  },
  components:{
    Swiper
  },

  // activated() { //路由活跃时，添加上离开时的路径
  //   this.$router.push(this.path)
  // },
  // beforeRouteLeave(to,from,next){ //离开路由组件前
  //   this.path = this.$route.path  //记录此时路由路径
  //   next()
  // },


  created() {
    this.apiInit()
  },
  methods:{
    apiInit(){
      api1({
        url: '/api/index_list/8/data/1'
      }).then(res => {
        this.newData = res.data
        //console.log(res.data)
      })
    },
    boxClick(){
      this.isActive = !this.isActive
      if(!this.isActive){
        document.getElementById("icon").style.transform = "rotate("+180+"deg)";
      }
      else{
        document.getElementById("icon").style.transform = "rotate("+360+"deg)";
      }

    }
  }
}
</script>

<style scoped lang="scss">
.BeatsPill{
  position: relative;
  top: 92px;
  right: 0;
  left: 0;
}
.title{
  text-align: center;
  font-size: xxx-large;
}
.container{
  margin-top: 50px;
  text-align: left;
  width: 8rem;
  float: right;
  ul{
    display: flex;
    flex-wrap: wrap;
    li{
      margin-top: 30px;
      margin-left: 30px;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-around;
      width: 500px;
      img{
        width: 90px;
        height: 90px;
      }
      span{
        font-size: 20px;
      }
    }
  }
  .box{
    width: 5rem;
    padding-top: 100px;
    img{
      width: 32px;
      height: 32px;
    }
  }
}
.message{
  ul{
    display: contents;
    li{
      width: 6.666667rem;
      text-align: left;
      align-items: start;
    }
  }
  span{
    font-size: 20px;
  }
}
</style>